
package com.shangsi.controller;

import com.shangsi.feignservice.fallback.PaymentFeignService;
import com.shangsi.feignservice.fallbackfactory.PaymentFeignService2;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author dzd
 * @date 2021-12-16
 */
@RestController
@RequestMapping("fallback")
public class OrderFallbackController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @Resource
    private PaymentFeignService2 paymentFeignService2;

    @RequestMapping("payment1/{id}")
    public String payment1(@PathVariable("id") Integer id){
        System.out.println("fallback payment1 :");
        return paymentFeignService2.getPayment(id);
    }


    @RequestMapping("payment2/{id}")
    public String payment2(@PathVariable("id") Integer id){
        System.out.println("fallback payment2 :");
        return paymentFeignService2.getPayment(id);
    }


}
